package com.zcl.jdbc;

import java.io.IOException;
import java.io.Serializable;
import java.sql.*;
import java.util.Properties;

public class JdbcUtils{

    public static void main(String[] args) {
        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        Connection conn = null;
        Statement stmt = null;
        ResultSet rs = null;
        try {
            String url = "jdbc:mysql://127.0.0.1:3306/herdsric_dsv_edi";
            String user = "root";
            String password = "18856235080";
            conn = DriverManager.getConnection(url, user, password);
            stmt = conn.createStatement();




            String sql = "" ;
            int i = stmt.executeUpdate(sql);

//            rs = stmt.executeQuery("select * from student");
//            while (rs.next()) {
//                System.out.println(rs.getInt("id") + "\t" + rs.getString(2) + "\t" + rs.getString(3) + "\t" + rs.getString("address"));
//            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                rs.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
            try {
                stmt.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
            try {
                conn.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }


}
